Public Class Language
    Private Const LANGUAGE_FILE As String = "D-AMPS.lng"
    Private Const DEFAULT_DATA As String = "Untranslated"

    Private Shared m_objProfile As AMS.Profile.Ini

    Public Shared Sub Initialize()
        Dim strFile As String = My.Computer.FileSystem.CombinePath(My.Application.Info.DirectoryPath, LANGUAGE_FILE)

        m_objProfile = New AMS.Profile.Ini(strFile)
        If ReadInfo("Application") <> "D-AMPS" Then
            Throw New Exception("Invalid language file. Reinstall aplication.")
        End If
    End Sub

    Public Shared Function ReadAbout(ByVal key As String) As String
        Return m_objProfile.GetValue("About", key, DEFAULT_DATA)
    End Function

    Public Shared Function ReadInfo(ByVal key As String) As String
        Return m_objProfile.GetValue("Info", key, DEFAULT_DATA)
    End Function

    Public Shared Function ReadMain(ByVal key As String) As String
        Return m_objProfile.GetValue("Main", key, DEFAULT_DATA)
    End Function

    Public Shared Function ReadMessages(ByVal key As String) As String
        Return m_objProfile.GetValue("Messages", key, DEFAULT_DATA)
    End Function

    Public Shared Function ReadOutputs(ByVal key As String) As String
        Return m_objProfile.GetValue("Outputs", key, DEFAULT_DATA)
    End Function

    Public Shared Function ReadProperties(ByVal key As String) As String
        Return m_objProfile.GetValue("Properties", key, DEFAULT_DATA)
    End Function

    Public Shared Function ReadRegions(ByVal key As String) As String
        Return m_objProfile.GetValue("Regions", key, DEFAULT_DATA)
    End Function

    Public Shared Function ReadWavelengths(ByVal key As String) As String
        Return m_objProfile.GetValue("Wavelengths", key, DEFAULT_DATA)
    End Function

End Class
